<!DOCTYPE html>
<html>
<head>
	<title><? if (isset($title)) echo $title.' - ';?>SimpleBlog CMS admin</title>
	<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" type="text/css" href="<?=base_url()?>css/admin/main.css" />
	<script type="text/javascript" src="<?=base_url()?>js/jquery.js"></script>
	<script type="text/javascript" src="<?=base_url()?>link/js_vars"></script>
<? if (!empty($addJS) && is_array($addJS)){
	foreach ($addJS as $js):?>
	<script type="text/javascript" src="<?=$js?>"></script>
<? endforeach;}?>
<? if (!empty($addCSS) && is_array($addCSS)){
	foreach ($addCSS as $css):?>
	<link rel="stylesheet" type="text/css" href="<?=$css?>" />
<? endforeach;}?>
</head>
<body>
	<? global $config; ?>
	<div id="mainDiv">
		<div id="headDiv">
			SimpleBlog CMS v_<?=SB_VERSION?> | <a href="<?=base_url()?>">Перейти на сайт</a> 
		</div>
		<div id="menuDiv">
			<a href="/admin" class="menuLink">Главная</a>
		<? if (($this->user->checkRight(1) || $this->user->checkRight(4))) :?>
			<a href="/admin/pages" class="menuLink">Страницы</a>
		<? endif; ?>
		<? if (($this->user->checkRight(1) || $this->user->checkRight(2) || $this->user->checkRight(8))) :?>
			<a href="/admin/articles" class="menuLink">Статьи</a>
		<? endif; ?>
		<? if ($this->user->checkRight(3)) :?>
			<a href="/admin/users" class="menuLink">Пользователи</a>
		<? endif; ?>
		<? if ($this->user->checkRight(5)) :?>
			<a href="/admin/blocks" class="menuLink">Блоки</a>
		<? endif; ?>
		<? if ($this->user->checkRight(6)) :?>
			<a href="/admin/mailing/templates" class="menuLink">Шаблоны писем</a>
			<a href="/admin/mailing" class="menuLink">Рассылки</a>
		<? endif; ?>
		<? if ($this->user->checkRight(7)) :?>
			<a href="/admin/comments" class="menuLink">Комментарии</a>
		<? endif; ?>
			<a href="/admin/files" class="menuLink">Файлы</a>
		<? if ($this->user->isAdmin()) :?>
			<a href="/admin/feedback" class="menuLink">Обратная связь</a>
		<? endif; ?>
		<? if ($this->user->isAdmin()) :?>
			<a href="/admin/configure" class="menuLink">Настройки</a>
		<? endif; ?>
		<? if ($this->user->isAdmin()) :?>
			<a href="/admin/update" class="menuLink">Обновления</a>
		<? endif; ?>
		</div>
		<div id="middleDiv">
			<?=isset($content)?$content:' '?>
		</div>
	</div>
</body>
</html>